USE [influenza]
GO

/****** Object:  StoredProcedure [dbo].[SP_avisos]    Script Date: 12/30/2009 20:10:02 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[SP_avisos]
@aviso varchar(2)
as
Begin
set dateformat mdy

declare @qry varchar(255)

if @aviso=1
	begin
		Select aviso from dat_avisos Where activo=1
	end
else if @aviso=2
	begin
		Select aviso, CONVERT(varchar(10),fRegistro,103) as fRegistro from dat_avisos Where listado=1
	end
else if @aviso=3
    begin
    Select id_aviso, aviso, CONVERT(varchar(10),fRegistro,103) as fRegistro,activo,listado  from dat_avisos Order by id_aviso desc
    end
End
GO

